<form action="{:U('contract/add')}" method="post">
	<input type="hidden" name="business_id" value="{$business_id}">
	<input type="hidden" name="refer_url" value="{$refer_url}">
	<table class="table" width="95%" border="0" cellspacing="1" cellpadding="0">
		<tfoot>
			<tr> 
				<td>&nbsp;</td>
				<td <if condition="C('ismobile') neq 1">colspan="3"</if>><input name="submit" class="btn btn-primary" type="submit" value="{:L('CREATE')}"/></td>					
			</tr>
		</tfoot>
		<tbody width="100%">
			<tr><th <if condition="C('ismobile') neq 1">colspan="4"<else/>colspan="2"</if>>{:L('BASIC_INFO')}</th></tr>
			<tr>
				<td width="15%" class="tdleft">{:L('CONTRACT_NO')}</td>
				<td width="35%"><input  type="text" name="number" id="number" value="{$contract_custom}"></td>
				<if condition="C('ismobile') eq 1"></tr><tr></if>
				<td class="tdleft">{:L('SIGNING_TIME')}</td>
				<td><input onclick="WdatePicker()"  type="text" id="due_time" name="due_time"/></td>
			</tr>
			<tr>
				<td class="tdleft">{:L('OWNER_ROLE_CLICK_ON_THE_SELECT')}</td>
				<td><input type="hidden" name="owner_role_id" id="owner_id" value="{$Think.session.role_id}"/>
				<input type="text" name="owner_role_name" id="owner_name" value="{$Think.session.name}"/></td>
				<if condition="C('ismobile') eq 1"></tr><tr></if>
				<td class="tdleft">{:L('QUOTATION')}</td>
				<td><input type="text" name="price" id="price"/></td>
			</tr>
			<tr>
				<td class="tdleft">{:L('TERMS_AND_CONDITIONS')}</td>
				<td <if condition="C('ismobile') neq 1">colspan="3"</if>><textarea class="span6" rows="3" name="content" id="content"></textarea></td>
			</tr>
			<tr>
			</tr>
			<tr>
				<td class="tdleft">{:L('THE_CONTRACT_DESCRIPTION')}</td>
				<td <if condition="C('ismobile') neq 1">colspan="3"</if>><textarea class="span6" rows="3" name="description" id="description"></textarea></td>
			</tr>
		</tbody>
	</table>
</form>
<div id="dialog-role-list2" title="{:L('SELECT_HEAD')}">loading...</div>
<script type="text/javascript">
<if condition="C('ismobile') eq 1">width=$('.container').width() * 0.9;<else/>width=600;</if>
$(function(){
	$('#owner_name').click(function () {
		$('#dialog-role-list2').dialog('open');
		$('#dialog-role-list2').load('{:U("user/listDialog")}');
		return false;
	});
});
$("#dialog-role-list2").dialog({
	autoOpen: false,
	modal: true,
	width: width,
	maxHeight: 400,
	buttons: { 
		"Ok": function () {
			var item = $('input:radio[name="owner"]:checked').val();
			var name = $('input:radio[name="owner"]:checked').parent().next().html();
			$('#owner_id').val(item);
			$('#owner_name').val(name);
			$(this).dialog("close"); 
		},
		"Cancel": function () {
			$(this).dialog("close");
		}
	},
	position: ["center", 100]
});
</script>	